import server from "../util/request.js";

// 查询所有部门
export function findAllDepartments() {
    return server({
        url: '/department/findAll',
        method: 'GET'
    });
}

// 添加部门
export function addDepartment(data) {
    return server({
        url: '/department/add',
        method: 'POST',
        data: data
    });
}

// 更新部门
export function updateDepartment(data) {
    return server({
        url: '/department/update',
        method: 'PUT',
        data: data
    });
}

// 删除部门
export function deleteDepartment(deptId) {
    return server({
        url: `/department/delete/${deptId}`,
        method: 'DELETE'
    });
}